﻿//
// Copyright (C) Canyala Innovation AB 2011
//

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Canyala.Lagoon.Presentation
{
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
    public class DependsOnAttribute : Attribute
    {
        private readonly HashSet<string> _dependsOn;

        public bool HasDependencyOn(string name) 
            { return _dependsOn.Contains(name); }

        public DependsOnAttribute(params string[] propertyNameArguments) 
            { _dependsOn = new HashSet<string>(propertyNameArguments); }
    }
}